package SynchronizedDemo.Synchronized03;

import SynchronizedDemo.Synchronized02.RunnableImpl;

/**
 * @Author: ylc
 * @Description:模拟卖票案例，创建三个线程，同时开启对共享的票进行出售
 * @Date Created in 2022-04-20 16:57
 */
public class Demo3Ticket {
    public static void main(String[] args) {
        //创建Runnable接口的实现类对象
        RunnableImpl run = new RunnableImpl();
        //创建Thread类对象,构造方法中传递Runnable接口的实现类对象
        Thread t0 = new Thread(run);
        Thread t1 = new Thread(run);
        Thread t2 = new Thread(run);
        //调用start方法开启多线程
        t0.start();
        t1.start();
        t2.start();
    }
}
